<?php
class Core_Backend_Component_Index_View_Index_password extends Core_Backend_Share_View_Form {

    public function __construct(){
        parent::__construct();
    }

    protected function buildNavigation($navigation){
        $navigation->addLabel($this->__f('share.label.change', '{share.label.password}'));
        parent::buildNavigation($navigation);
    }

    protected function buildToolbar($toolbar){
       
        $group = $toolbar->createGroup('save');
        
        $group->addButton($this->__('share.button.save'))
        	  ->bindEvent('click', "Kdf.Ui.getForm('".$this->getForm()->getId()."').submit('".$this->getUrl(NULL, 'password')."')");
          parent::buildToolbar($toolbar);
    }

    protected function buildForm($form){
    	$entity = $this->getModel(NULL);
        $form->setAction($this->getUrl())
                ->addClass('category')
             ->setId('password_form')
             ->addPasswordField($this->__f('share.label.old', '{share.label.password}'),'oldPassword', 'oldPassword', TRUE)
             ->addValidateRule('required')->addClass('index')->getForm()
             ->addPasswordField($this->__f('share.label.new', '{share.label.password}'),'newPassword','newPassword',TRUE)
             ->addValidateRule('required')->addClass('index')->getForm()
             ->addPasswordField($this->__f('share.label.confirm','{share.label.password}'),'confirmPassword','confirmPassword',TRUE)
//                ->addValidateRule('equal', "'#newPassword'")
                ->addValidateRule('required')->addClass('index')->getForm();

        parent::buildForm($form);
    }
}
?>
